
$.ajaxSetup({
	cache: false
});
$(document).ready(function() {
	$('body').append('<div id="loading_box">' + lang.process_request + '</div>');
	$('#loading_box').ajaxStart(function(){
		var loadingbox = $(this);
		var left = -(loadingbox.outerWidth() / 2);
		loadingbox.css({'marginRight': left + 'px'});
		loadingbox.delay(3000).fadeIn(400);
	});
	$('#loading_box').ajaxSuccess(function(){
		$(this).stop().stop().fadeOut(400);
	});
});
var loader = '<div class="loader">&nbsp;</div>', result = '<div class="result"></div>', status = '<div class="status"></div>', page = 'undefined', action = 'undefined';

(function($) {
$.fn.GoodsCleariy = function() {
	$('.first_child', this).before('<hr class="clearer"/>');
};
})(jQuery);




function isValidEmail(email) {
	var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	return filter.test(email);
}

function getAttrSiy(area) {
	var attrList = new Array();
	area.find('input[name^="spec_"]:checked, select[name^="spec_"]').each(function(i) {
		attrList[i] = $(this).val();
	});
	return attrList;
}



function openSpeSiy(message, goods_id, num, parent) {
	var html = '<div class="message_box" id="properties_box"><div class="properties_wrapper">';
	for (var spec = 0; spec < message.length; spec++) {
		var tips = '';
		if (message[spec]['attr_type'] == 2) {
			var tips = 'title="' + lang.multi_choice + '"';
		};
		html += '<dl class="properties clearfix" ' + tips + '><dt>' +  message[spec]['name'] + '：</dt>';
		if (message[spec]['attr_type'] == 1) {
			html += '<dd class="radio">';
			for (var val_arr = 0; val_arr < message[spec]['values'].length; val_arr++) {
				var check = '';
				var title = '';
				if (val_arr == 0) {
					var check = 'checked="checked"';
				}
				if (message[spec]["values"][val_arr]["price"] != '') {
					var title = 'title="' + lang.add + message[spec]["values"][val_arr]["format_price"] + '"';
				}
				html += '<label for="spec_value_'+ message[spec]["values"][val_arr]["id"] +'" ' + title + '><input type="radio" name="spec_' + message[spec]["attr_id"] + '" value="' + message[spec]["values"][val_arr]["id"] + '" id="spec_value_' + message[spec]["values"][val_arr]["id"] + '" ' + check + ' />' + message[spec]["values"][val_arr]["label"] + '</label>';
			} 
			html += '<input type="hidden" name="spec_list" value="' + val_arr + '" /></dd>';
		}
		else {
			html += '<dd class="checkbox">';
			for (var val_arr = 0; val_arr < message[spec]["values"].length; val_arr++) {
				var title = '';
				if (message[spec]["values"][val_arr]["price"] != '') {
					var title = 'title="' + lang.add + message[spec]["values"][val_arr]["format_price"] + '"';
				}
				html += '<label for="spec_value_' + message[spec]["values"][val_arr]["id"] + '" ' + title + '><input type="checkbox" name="spec_' + message[spec]["attr_id"] + '" value="' + message[spec]["values"][val_arr]["id"] + '" id="spec_value_' + message[spec]["values"][val_arr]["id"] + '" />' + message[spec]["values"][val_arr]["label"] + '</label>';
			}
			html += '<input type="hidden" name="spec_list" value="' + val_arr + '" /></dd>';
		}
		html += "</dl>";
	}
	html += '</div><p class="action"><a href="javascript:submitSpeSiy(' + goods_id + ',' + num + ',' + parent + ')" class="buy button brighter_button"><span>' + lang.buy + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>';
	
	$.fn.colorbox({scrolling:false,html: html,title: lang.select_spe});
	$('.properties').Formiy();
	$('.properties dl').tipsy({gravity: 'e',fade: true,html:true});
	$('.properties label').tipsy({gravity: 's',fade: true,html:true});
}







function validAndTip(obj){if(obj.isValid()){obj.tipsy('hide');}else{obj.tipsy('show');}return false;}
function validAndTipNext(obj){if(obj.isValid()){obj.next().tipsy('hide');}else{obj.next().tipsy('show');}return false;}

function validLogin() {
	$('#username_login, #password_login').valid8('').tipsy({gravity: 'w', fade: true, trigger: 'manual'}).focusout(function(){validAndTip($(this));}).keyup(function(){validAndTip($(this));});
	$('#username_login').focus().attr('original-title', lang.error_username_required);
	$('#password_login').attr('original-title', lang.error_password_required);
	if ($('#captcha_login').length > 0) {
		$('#captcha_login').valid8('').next().tipsy({gravity: 'w', fade: true, trigger: 'manual'}).attr('original-title', lang.error_captcha_required);
		$('#captcha_login').focusout(function(){validAndTipNext($(this));}).keyup(function(){validAndTipNext($(this));});
	}
	$('#user_login').submit(function(){
		var unc = 0,pwc = 0,ccc = 0;
		validAndTip($('#username_login'));
		validAndTip($('#password_login'));
		if ($('#username_login').val() != '') {unc = 1};
		if ($('#password_login').val() != '') {pwc = 1};
		if ($('#captcha_login').length > 0) {
			validAndTipNext($('#captcha_login'));
			if ($('#captcha_login').val() != '') {ccc = 1};
			if(unc+pwc+ccc == 3){
				return true;
			} else {
				return false;
			}
		} else {
			if(unc+pwc+ccc == 2){
				return true;
			} else {
				return false;
			}
		};
	});
}

function openQuickLogin() {
	$.fn.colorbox({scrolling:false,href:'member_login2.html',onComplete:function(){
			$('.tipsy').remove();
			validQuickLogin();
		},onCleanup:function(){
			$('.tipsy').remove();
		}
	});
}

function validAndTip2(obj){if(obj.val() != ''){obj.tipsy('hide');}else{obj.tipsy('show');}return false;}
function validAndTipNext2(obj){if(obj.val() != ''){obj.next().tipsy('hide');}else{obj.next().tipsy('show');}return false;}

function validQuickLogin() {
	$('#user_login .tip').tipsy({gravity: 's',fade: true,html: true});
	$('#username_login, #password_login').tipsy({gravity: 'w', fade: true, trigger: 'manual'}).focusout(function(){validAndTip2($(this));}).keyup(function(){validAndTip2($(this));});//
	$('#username_login').focus().attr('original-title', lang.error_username_required);
	$('#password_login').attr('original-title', lang.error_password_required);
	if ($('#captcha_login').length > 0) {
		$('#captcha_login').next().tipsy({gravity: 'w', fade: true, trigger: 'manual'}).attr('original-title', lang.error_captcha_required);
		$('#captcha_login').focusout(function(){validAndTipNext2($(this));}).keyup(function(){validAndTipNext2($(this));});//
	}
	$('#user_login').submit(function(){
		var unc = 0,pwc = 0,ccc = 0;
		validAndTip2($('#username_login'));
		validAndTip2($('#password_login'));
		if ($('#username_login').val() != '') {unc = 1};
		if ($('#password_login').val() != '') {pwc = 1};
		if ($('#captcha_login').length > 0) {
			validAndTipNext2($('#captcha_login'));
			if ($('#captcha_login').val() != '') {ccc = 1};
			if(unc+pwc+ccc == 3){
				quickLogin();
				return false;
			} else {
				return false;
			}
		} else {
			if(unc+pwc+ccc == 2){
				quickLogin();
				return false;
			} else {
				return false;
			}
		};
	});
}

/* =snatch */



function regionChanged(obj, type, selName) {
	var parent = obj.options[obj.selectedIndex].value;
	loadRegions(parent, type, selName);
}
function loadRegions(parent, type, target) {
	/*var target = $('#'+target+'');
	target.after(loader).next('.loader').css({visibility:'visible'}).fadeTo(0, 1000);
	$.get(
		'region.php',
		'type=' + type + '&target=' + target + "&parent=" + parent,
		function(response){
			var res = $.evalJSON(response);
			target.next('.loader').fadeTo(500, 0, function(){
				$(this).remove();
			});
			target.find('option[value!="0"]').remove();
			if (res.regions.length == 0) {
				target.css('display','none');
				target.nextAll('select').css('display','none');
			} else {
				target.css('display','');
				for (i = 0; i < res.regions.length; i ++ ) {
					target.append('<option value="' + res.regions[i].region_id + '">' + res.regions[i].region_name + '</option>');
				}
			};
		},
		'text'
	);*/
}




/*function closeCart() {
	$('#cart .list_wrapper').hide();
}*/
//弹出确认
function cAlert(content) {
	$('.tipsy').css({zIndex:'100'});
	$.fn.colorbox({transition:'none',html:'<div class="message_box mb_info">' + content + '<p class="action"><a href="javascript:void(0);" class="button brighter_button" onclick="$.fn.colorbox.close(); return false;"><span>' + lang.confirm + '</span></a></p></div>'});
}

//复位
/*function reset_html(id) {
	$('#'+id).html($('#'+id).html());
}
*/

function eventInit() {
	var container = $('#auction_active .item_list_wrapper');
	container.isotope({
		itemSelector : '.item',
		getSortData : {
			start_price : function ( $elem ) {
				return parseInt($elem.attr('start_price'));
			},
			end_price : function ( $elem ) {
				return parseInt($elem.attr('end_price'));
			},
			latest_price : function ( $elem ) {
				return parseInt($elem.attr('latest_price'));
			},
			latest_time : function ( $elem ) {
				return parseInt($elem.attr('latest_time'));
			}
		}
	});
	$('#item_list_filter a').click(function(){
		var $this = $(this);
		if ($this.hasClass('selected')){
			return false;
		}
		$this.addClass('selected').siblings().removeClass('selected');
		var selector = $this.attr('data-filter');
		if ($('#filter_type_has_bid').hasClass('selected')) selector = selector+'.has_bid';
		if ($('#filter_type_attention').hasClass('selected')) selector = selector+'.has_attention';
		container.isotope({filter:selector});
		return false;
	});
	$('#item_list_filter_type a').click(function(){
		var $this = $(this);
		if ($this.hasClass('selected')){
			$this.removeClass('selected checked');
			var selector = $('#item_list_filter .selected').first().attr('data-filter');
			var another = $this.siblings('a').first();
			if (another.hasClass('selected')) selector = selector+another.attr('data-filter');
			container.isotope({filter:selector});
		} else {
			$this.addClass('selected checked');
			var selector = $('#item_list_filter .selected').first().attr('data-filter');
			selector = selector+$this.attr('data-filter');
			var another = $this.siblings('a').first();
			if (another.hasClass('selected')) selector = selector+another.attr('data-filter');
			container.isotope({filter:selector});
		}
		return false;
	});
	$('#item_list_sort a').click(function(){
		var $this = $(this);
		$this.addClass('selected').siblings().removeClass('selected arrow');
		var sort = $this.attr('id').slice(8);
		var selector = $('#item_list_filter .selected').attr('data-filter');
		if ($('#filter_type_has_bid').hasClass('selected')) selector = selector+'.has_bid';
		if ($('#filter_type_attention').hasClass('selected')) selector = selector+'.has_attention';
		if (sort == 'original') {
			container.isotope({sortBy:'original-order',sortAscending:true,filter:selector});
		} else if (sort == 'start_price') {
			if ($this.hasClass('arrow')) {
				if ($this.hasClass('arrow_up')) {
					$this.removeClass('arrow_up').addClass('arrow_down');
					container.isotope({sortBy:sort,sortAscending:false,filter:selector});
				} else {
					$this.removeClass('arrow_down').addClass('arrow_up');
					container.isotope({sortBy:sort,sortAscending:true,filter:selector});
				}
			} else {
				$this.addClass('arrow arrow_up');
				container.isotope({sortBy:sort,sortAscending:true,filter:selector});
			}
		} else if (sort == 'end_price') {
			if ($this.hasClass('arrow')) {
				if ($this.hasClass('arrow_up')) {
					$this.removeClass('arrow_up').addClass('arrow_down');
					container.isotope({sortBy:sort,sortAscending:false,filter:selector});
				} else {
					$this.removeClass('arrow_down').addClass('arrow_up');
					container.isotope({sortBy:sort,sortAscending:true,filter:selector});
				}
			} else {
				$this.addClass('arrow arrow_up');
				container.isotope({sortBy:sort,sortAscending:true,filter:selector});
			}
		} else if (sort == 'latest_price') {
			if ($this.hasClass('arrow')) {
				if ($this.hasClass('arrow_up')) {
					$this.removeClass('arrow_up').addClass('arrow_down');
					container.isotope({sortBy:sort,sortAscending:false,filter:selector});
				} else {
					$this.removeClass('arrow_down').addClass('arrow_up');
					container.isotope({sortBy:sort,sortAscending:true,filter:selector});
				}
			} else {
				$this.addClass('arrow arrow_up');
				container.isotope({sortBy:sort,sortAscending:true,filter:selector});
			}
		} else if (sort == 'latest_time') {
			if ($this.hasClass('arrow')) {
				if ($this.hasClass('arrow_up')) {
					$this.removeClass('arrow_up').addClass('arrow_down');
					container.isotope({sortBy:sort,sortAscending:true,filter:selector});
				} else {
					$this.removeClass('arrow_down').addClass('arrow_up');
					container.isotope({sortBy:sort,sortAscending:false,filter:selector});
				}
			} else {
				$this.addClass('arrow arrow_up');
				container.isotope({sortBy:sort,sortAscending:false,filter:selector});
			}
		}
		return false;
	});
	$('#auction_display_switcher .list').click(function() {
		$(this).addClass('current_list').siblings().removeClass('current_grid');
		$('#auction_active').addClass('auction_display_list').removeClass('auction_display_grid');
		$.cookie('auction_display', 'list');
		container.isotope({
			itemSelector : '.item'
		});
		return false;
	});
	$('#auction_display_switcher .grid').click(function() {
		$(this).addClass('current_grid').siblings().removeClass('current_list');
		$('#auction_active').addClass('auction_display_grid').removeClass('auction_display_list');
		$.cookie('auction_display', 'grid');
		container.isotope({
			itemSelector : '.item'
		});
		return false;
	});
	$('#auction_display_switcher .fullscreen').click(function() {
		if($('body').hasClass('auction_fullscreen')){
			$('body').removeClass('auction_fullscreen');
			$.cookie('auction_fullscreen', '');
			container.isotope({
				itemSelector : '.item'
			});
		} else {
			$('body').addClass('auction_fullscreen');
			$.cookie('auction_fullscreen', 'true');
			container.isotope({
				itemSelector : '.item'
			});
			var innerWidth = $('#auction_active').innerWidth();
			$('style.fullscreen_css').remove();
			var itemInnerWidth = innerWidth - 2;
			var itemNameWidth = innerWidth - 610;
			var style = '<style type=\"text\/css\" class=\"fullscreen_css\">.auction_fullscreen .auction_display_list .item{width:'+innerWidth+'px;}.auction_fullscreen .auction_display_list .item_inner{width:'+itemInnerWidth+'px;}.auction_fullscreen .auction_display_list .item .name{width:'+itemNameWidth+'px;}<\/style>';
			$('body').append(style);
		}
		return false;
	});
}
//作品列表页刷新
function auctionRefresh() {
	var container = $('#auction_active .item_list_wrapper');
	var refreshLoader = $('#auction_refresh .loader');
	refreshLoader.stop().css({visibility:'visible'}).fadeTo(0, 1000);
	$('#auction_active .item').removeClass('has_updated');
	var auctionId=$("#auctionId").val();
	
	$.get("/event.htm?id="+auctionId,function(data){
		var res = $.evalJSON(data);
		$('#latest_price_total').html('<em class="price" id="latest_price_total">'+res.bidPrice+'<sup>RMB</sup></em>');
		refreshLoader.stop().fadeTo(1000, 0);	
		watchCountdown();
	}); 
}

function watchCountdown() {
	var seconds = 59;
		$('#waiting_time').text(seconds);
		var sp = (60 - seconds) / 60 * 100;
				$('#waiting_bar').addClass('first_start');
				intWatingBar(sp, seconds * 1000);
		
}

function watchCountdownPic() {
	var seconds = 59;
		$('#waiting_time').text(seconds);
		var sp = (60 - seconds) / 60 * 100;
				$('#waiting_bar').addClass('first_reset');
				intWatingBar(sp, seconds * 1000);
		
}

function intWatingBar(sp,duration) {
	$('#waiting_bar .bar').stop().css({width:'0'}).animate({width:'100%'}, duration, 'linear', function(){
		if ($('#page_event').length > 0) {
			//alert("page_event");
			auctionRefresh();
		} else {
			//alert("11");
			auctionItemRefresh();
		}
	});
}
function auctionAction(id,auctionId) {
	
	if(ART.checkLogin()){
		var target = $('#auction_'+id);
		if (target.hasClass('finished')) {
			window.open(target.find('a.action').attr('href'));
			return false;
		} else {
			var min_price = parseInt(target.attr('min_price'));
			var bid_range = parseInt(target.attr('bid_range'));
			var html = '<div class="placard"><div class="number_picker"><a href="javascript:;" class="minus">-</a><input name="price" type="text" min="'+min_price+'" step="'+bid_range+'" value="'+min_price+'" /><a href="javascript:;" class="plus">+</a></div><p class="placard_actions"><a href="javascript:bidAA('+id+','+auctionId+');" class="button brighter_button bid_now"><span>'+lang.bid_now+'</span></a><a href="javascript:cancelAA('+id+');" class="button text_button cancel"><span>'+lang.cancel+'</span></a></p><span class="loader">&nbsp;</span></div>';
			target.find('.actions').append(html);
			numberPickerInt();
	}
	}else{
		alert("请登录~");
		window.location.href="login.htm"
	}
}
function cancelAA(id) {
	var target = $('#auction_'+id);
	target.find('.placard').remove();
}


/*function tagFormInt() {
	var form = $('#tag_form');
	$('.top_tags .item', form).click(function(){
		var item = $(this);
		var input = $('[name=tag]', form);
		var tag = $('[name=tag]', form).val();
		if (tag != '') {
			input.val(tag + ',' + item.text());
		} else {
			input.val(item.text());
		}
		input.focus();
		return false;
	});
}*/
function auctionItemRefresh() {
	var id= $("#pId").val();
	var aid= $("#aId").val();
	window.location.href="auctionpic.htm?id="+id+"&aid="+aid;
}
/*function auctionItemRefresh() {
	auctionRefresh();
	}*/
/*function memberOnlyNotice(){
	if ($.cookie('close_mon') != 'true') {
		var html = '<div id="member_only_notice"><span class="arrow">&nbsp;</span><a href="javascript:closeMON();" class="close">×</a><p>'+lang.member_only_notice+'</p></div>';
		$('#header .container').append(html);
	}
}*/
/*function closeMON(){
	$.cookie('close_mon', 'true');
	$('#member_only_notice').remove();
}*/
/*
function refreshPage() {
	window.location.reload();
}*/
function eventRemind(id,type){
	var html = '<form action="" method="post" class="form event_remind_form" id="event_remind_form"><fieldset><h4>'+lang.set_event_remind+'</h4>';
	html += '<label for="er_email"'+(type =='sms'?' style="display:none"':'')+'><b>'+lang.email_address+lang.colon+'</b><input type="text" value="" name="email" id="er_email" /></label>';
	html += '<div class="submit_wrap"><input type="submit" value="'+lang.confirm+'" tabindex="18" class="submit btn_s2_b"/><input type="hidden" name="event_id"  value="'+id+'" id="er_event_id" /></div></form>';
	var eventName = $('#event_'+id).find('.name').text();
	$.fn.colorbox({scrolling:false,html:html,title:eventName,onCleanup:function(){
		$('.tipsy').remove();
	}});
	$('#er_mobile, #er_email').tipsy({gravity: 'w', fade: true, trigger: 'manual'}).parent().append(status);
	$('#event_remind_form').submit(function(){
		var  email  =$('#er_email').val();
		var  event_id = $('#er_event_id').val();
		$('#er_email').blur(function(){
			var em = $(this);
			var email = em.val();
			var status = $('.status',em.parent());
			if (email == '') { 
				em.attr('original-title', lang.error_email_required).tipsy('show');
				status.removeClass('valid');
				return false;
			} else if (!isValidEmail(email)) {
				em.attr('original-title', lang.error_email_format).tipsy('show');
				status.removeClass('valid');
				return false;
			} else {
				em.tipsy('hide');
				status.addClass('valid');
			}
		});
		$.post(
			'reminder.htm',
			{email: email,
			typeId :event_id	
			},
			function(date){
				if (date == "error") {
					var message="很抱歉，订阅出错了。"
					$.fn.colorbox({html:'<div class="message_box mb_info">' + message + '<p class="action"><a href="javascript:void(0);" class="button brighter_button" onclick="eventRemind('+id+')"><span>' + lang.re_fill + '</span></a></p></div>'});
				} else {
					var message="订阅成功啦。"
					$.fn.colorbox({html:'<div class="message_box mb_info">' + message + '<p class="action"><a href="javascript:void(0);" class="button brighter_button" onclick="$.fn.colorbox.close(); return false;"><span>' + lang.confirm + '</span></a></p></div>'});
				}
			},
			'text'
		);
		return false;
	});
}
function numberPickerInt() {
	$('.number_picker').each(function(){
		var picker = $(this);
		var input = picker.find('input');
		var minus = picker.find('.minus');
		var plus = picker.find('.plus');
		minus.click(function(){
			var value = (parseInt(input.val()) > 0 ) ? parseInt(input.val()) : 0;
			var min = (parseInt(input.attr('min')) > 0 ) ? parseInt(input.attr('min')) : 1;
			var step = (parseInt(input.attr('step')) > 0 ) ? parseInt(input.attr('step')) : 1;
			if ((value - step) > min ) {
				input.val(value - step);
			} else {
				input.val(min);
			}
			return false;
		});
		plus.click(function(){
			var value = (parseInt(input.val()) > 0 ) ? parseInt(input.val()) : 0;
			var min = (parseInt(input.attr('min')) > 0 ) ? parseInt(input.attr('min')) : 1;
			var step = (parseInt(input.attr('step')) > 0 ) ? parseInt(input.attr('step')) : 1;
			if ((value + step) > min) {
				input.val(value + step);
			} else {
				input.val(min);
			}
			return false;
		});
	});
}

function bidAA(id,auctionId) {
	var target = $('#auction_'+id);
	var loader = target.find('.placard .loader');
	loader.css({visibility:'visible'}).fadeTo(0, 1000);
	var cancel = target.find('.placard .cancel');
	cancel.hide();
	if ($('#page_event').length > 0) {
		var price = parseInt(target.find('[name="price"]').val());
	}else{
		var price = parseInt($("#picPrice").find('[name="price"]').val());
	}
	
	if(/^\d+$/.test(price)){
		$.post(
				'bidArt.htm',
				{  
					id:id, 
					auctionId:auctionId,
					price:price
				},
				function(response){
					var res = $.evalJSON(response);
					if (res.error == "l") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="" class="button brighter_button"><span>' + lang.to_low + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					} else if (res.error == "s") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="mOrders.htm" class="button brighter_button"><span>' + lang.finished + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
						
					} else if (res.error > 0) {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + res.error + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					} else if (res.error == "empty") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + lang.goods_empty + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					}else if (res.error == "lasat") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + lang.goods_sale+ '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					}else if (res.error == "thread") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + lang.goods_thread+ '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					}else if (res.error == "join") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + lang.join+ '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					}else if (res.error == "nohaveAccount") {
						$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="aucart.htm?id='+auctionId+'" class="button brighter_button"><span>' + lang.have_account+ '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
					}
					
					loader.fadeTo(1000, 0);
					cancel.show();
				},
				'text'
			);
	}else{
		$.fn.colorbox({html:'<div class="message_box mb_question"><p class="action"><a href="verify_email" class="button brighter_button"><span>' + lang.to_number + '</span></a><a href="javascript:void(0);" class="tool_link" onclick="$.fn.colorbox.close(); return false;">' + lang.cancel + '</a></p></div>'});
	}
	return false;
	
	
}


function auctionInit() {
	$('#show_all_log').click(function() {
		$.fn.colorbox({height:'80%',width:'750px',inline:true,href:'#auction_log_all .collector_list',onOpen:function(){
				$('.tipsy').css({zIndex:'100'});
			},onClosed:function(){
				$('.tipsy').css({zIndex:'1000'});
			}
		});
		return false;
	});
	numberPickerInt();
}
